package com.example.wxai.controller;



import com.example.wxai.pijo.dto.AdminDto;
import com.example.wxai.pijo.entity.Admin;
import com.example.wxai.pijo.vo.AdminVo;
import com.example.wxai.result.Result;
import com.example.wxai.service.IAdminService;
import com.example.wxai.utils.BeanCopyUtils;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-02-27
 */
@Slf4j
@RestController
@RequestMapping("/admin")
public class AdminController {
    @Resource
    private IAdminService adminService;

    @PostMapping("/login")
    public Result<AdminVo> login(@RequestBody AdminDto adminDto){
        log.info("管理端登录{}",adminDto);
/*        Admin one = (Admin) adminService.lambdaQuery().eq(Admin::getAdmin, adminDto.getAdmin()).eq(Admin::getPassword, adminDto.getPassword()).one();
        AdminVo adminVo=new AdminVo();
        if(Objects.nonNull(one)){

            BeanCopyUtils.copyProperties(one,adminVo);
            adminVo.setToken(SaTempUtil.createToken(adminDto.getAdmin(),10000));
        }
        return Result.success(adminVo);*/
        return null;
    }


}
